package com.jiangxjsy.core.common;

import com.jiangxjsy.core.constant.UserIdentityConstant;
import lombok.Getter;

/**
 * wukong-crm-master
 * 蒋胜宇
 * 2025/6/6 19:54
 */

@Getter
public enum UserIdentity {
    PRIMARY_ACCOUNT(UserIdentityConstant.PRIMARY_ACCOUNT),
    DEPARTMENT_HEAD(UserIdentityConstant.DEPARTMENT_HEAD),
    ORDINARY_USER(UserIdentityConstant.ORDINARY_USER);

    private final Integer identity;

    UserIdentity(Integer identity) {
        this.identity = identity;
    }

    public static UserIdentity valueOf(Integer identity) {
        for (UserIdentity value : values()) {
            if (value.identity.equals(identity)) {
                return value;
            }
        }
        return ORDINARY_USER;
    }
}
